package it.polimi.traveldream.ejbclient.dtos;

import it.polimi.traveldream.utils.enums.BaseProductType;

import java.math.BigDecimal;
import java.util.Date;

public class TransportDTO extends BaseProductDTO{
	private static final long serialVersionUID = 9185559054151638904L;
	private final BaseProductType type = BaseProductType.TRANSPORT;
	private String company;
	private String departureCity;
	private String arrivalCity;
	
	public TransportDTO() {
		super();
	}

	public TransportDTO(int id, String description, Date endTrip, int maxAvailability,
			boolean overpast, BigDecimal price, int reservations, Date startTrip,
			String company, String departureCity, String arrivalCity) {
		super(id, description, endTrip, maxAvailability, overpast, price, reservations, startTrip);
		this.company = company;
		this.departureCity = departureCity;
		this.arrivalCity = arrivalCity;
	}


	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getDepartureCity() {
		return departureCity;
	}

	public void setDepartureCity(String departureCity) {
		this.departureCity = departureCity;
	}

	public String getArrivalCity() {
		return arrivalCity;
	}

	public void setArrivalCity(String arrivalCity) {
		this.arrivalCity = arrivalCity;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((type == null) ? 0 : type.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		TransportDTO other = (TransportDTO) obj;
		if (type != other.type)
			return false;
		return true;
	}
	
}
